#include "event_worker.h"

handler::event_worker::~event_worker() {}

void handler::event_worker::run()
{
	while(1) {
		if(is_interrupted()) {
			return;
		}
		boost::shared_ptr<network::message> tmp;
		try {
			tmp = _queue->get();
		} catch(...) {
			return;
		}
		if(_queue->is_interrupt()) {
			return;
		}
		boost::shared_ptr<handler::multicaster> multi(
			_dispatcher.lock());
		multi->dispatch(tmp);
		tmp.reset();
	}
}

